/**
 * 
 * app自定义弹框
 * @function agreePrivacy 应用市场上架用户隐私弹框
 * @function showModal 自定义对话框
 */
export default {
  getLink(params) {
    let url = "/components/dialog/dialog";
    if (params) {
      let paramStr = "";
      for (let name in params) {
        paramStr += `&${name}=${params[name]}`
      }
      if (paramStr) {
        url += `?${paramStr.substr(1)}`
      }
    }
    console.log('url', url);
    return url;
  },
  agreePrivacy() {
    const info = {
      isPact: true,
    }
    uni.navigateTo({
      url: this.getLink(info)
    })
  },
  showModal(title = "提示", content = "文案121212", confirmText = "确定", cancelText = "取消", confirmCallBack, cancelCallBack) {
    const info = {
      title,
      isShow: true,
      content,
      confirmText,
      cancelText,
      dialogType: 'confirm',
      confirmCallBack,
      cancelCallBack
    }
    uni.navigateTo({
      url: this.getLink(info)
    })
  }
}